import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { ResumeService } from './resume.service';
import { CreateResumeDto } from './resume.dto';

@ApiTags('简历模块')
@ApiBearerAuth()
@Controller('resume')
export class ResumeController {
  constructor(private resumeService: ResumeService) {}

  @Get('list/:id')
  @ApiOperation({ summary: '获取简历列表' })
  async getResumeList(@Param('id') uid: string) {
    return await this.resumeService.list(uid);
  }

  @Post('create/:id')
  @ApiOperation({ summary: '添加简历' })
  async createResume(@Param('id') uid: string, @Body() createResumeDto: CreateResumeDto) {
    return this.resumeService.create(uid, createResumeDto);
  }

  @Delete('delete/:id')
  @ApiOperation({ summary: '移除简历' })
  async removeResume(@Param('id') id: string) {
    return this.resumeService.remove(+id);
  }
}
